package com.kky.pp.activity.member.album

import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.kky.pp.R
import io.rong.imkit.event.EnumEventTag
import com.gyf.immersionbar.ImmersionBar
import com.kky.pp.App
import com.kky.pp.base.TitleMvpBaseActivity
import com.custom.base.base.SDBaseEvent
import com.kky.pp.databinding.ActPrivateAlbumBinding

/**
 * 私密相册
 */
class PrivateAlbumActivity : TitleMvpBaseActivity<PrivateAlbumContract.View, PrivateAlbumPresenter,ActPrivateAlbumBinding>(ActPrivateAlbumBinding::inflate),
    PrivateAlbumContract.View {
    override fun setFullScreen(): Boolean {
        return true
    }

    override fun isShowBack(): Boolean {
        return true
    }

    override fun setTitle(): String {
        return App.app?.resources?.getString(R.string.private_album)!!
    }


    override fun bindLayout(): Int {
        return R.layout.act_private_album
    }

    override fun initView() {
    }
    override fun onResume() {
        super.onResume()
        ImmersionBar.with(this@PrivateAlbumActivity).statusBarDarkFont(false).init()

    }
    override fun onEventMainThread(event: SDBaseEvent) {
        when (EnumEventTag.valueOf(event.tagInt)) {
            EnumEventTag.PRIVATE_ALBUMS_REMOVE->{
                mPresenter?.removePhoto(event.data.toString().toInt())
            }
            else -> {}
        }
    }


    override val rvSecretAlbumLists: RecyclerView
        get() = viewBinding.rvSecretAlbumList
    override val tvMiddleTitle: TextView?
        get() = viewBinding.viewTitle.tvMiddleTitle
    override val tvRightTitle: TextView?
        get() = viewBinding.viewTitle.tvRightTitle
    override val ivLeftImage: ImageView?
        get() = viewBinding.viewTitle.ivBackIcon
    override val viewStatusHeight: View?
        get() = viewBinding.viewTitle.viewStatusHeight


    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        mPresenter?.onActivityResult(requestCode, resultCode, data)
    }
}